import re

def _getMatrix():
    matrix=[]
    for i in range(3):
        line_str=input()
        num_lst=re.split('\\s+',line_str)
        #print(num_lst)
        matrix.append([eval(num) for num in num_lst])
    return matrix


def _matrixMuilt(matrix1,matrix2):

    if len(matrix1[0])!=len(matrix2):
        print('Wrong!')

    matrix=[]
    for i in range(len(matrix1)):
        row_lst=[]
        for j in range(len(matrix2[i])):
            elem=0
            for k in range(len(matrix1[0])):
                elem+=matrix1[i][k]*matrix2[k][j]
            row_lst.append(elem)
        matrix.append(row_lst)

    return matrix

def _printMatrix(matrix):
    for i in range(len(matrix)):
        for j in range(len(matrix[i])-1):
            print(matrix[i][j],end=" ")
        print(matrix[i][len(matrix[i])-1],end=" \n")

_printMatrix(_matrixMuilt(_getMatrix(),_getMatrix()))

